/* pages/chat/chat.wxss */
.container {
  height: 100vh;
  background: #f5f7fb;
  display: flex;
  flex-direction: column;
}

.title {
  text-align: center;
  font-size: 36rpx;
  color: #333;
  margin: 0rpx 0rpx 0rpx 0; /* 上下间距控制标题与搜索框的距离 */
  font-weight: bold;
}

/* 消息列表 */
.message-list {
  flex: 1;
  padding: 24rpx;
  padding-bottom: 160rpx;
}

/* 消息公共样式 */
.message-item {
  margin: 32rpx 0;
  opacity: 0;
  transform: translateY(20rpx);
  animation: messageIn 0.3s ease forwards;
}

@keyframes messageIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 用户消息 */
.user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.user-bubble {
  background: #1890ff;
  border-radius: 16rpx 16rpx 0 16rpx;
  max-width: 80%;
  position: relative;
}

.user-bubble .message-tail {
  position: absolute;
  right: -8rpx;
  bottom: 0;
  width: 0;
  height: 0;
  border: 12rpx solid transparent;
  border-left-color: #1890ff;
  border-bottom-color: #1890ff;
}

/* AI消息 */
.bot {
  display: flex;
  align-items: flex-start;
}

.bot-avatar {
  width: 80rpx;
  height: 80rpx;
  border-radius: 50%;
  margin-right: 24rpx;
  flex-shrink: 0;
}

.bot-bubble {
  background: #fff;
  border-radius: 16rpx 16rpx 16rpx 0;
  max-width: 75%;
  box-shadow: 0 4rpx 12rpx rgba(0,0,0,0.05);
}

.bot-bubble .message-tail {
  position: absolute;
  left: -8rpx;
  bottom: 0;
  width: 0;
  height: 0;
  border: 12rpx solid transparent;
  border-right-color: #fff;
  border-bottom-color: #fff;
}

/* 消息内容 */
.message-bubble {
  padding: 24rpx;
  position: relative;
  min-height: 80rpx;
}

.message-text {
  font-size: 28rpx;
  line-height: 1.6;
  color: #333;
}

.user-bubble .message-text {
  color: #fff;
}

/* 时间 */
.time {
  font-size: 24rpx;
  color: #999;
  margin-top: 12rpx;
}

/* 输入区域 */
/* 修改后的样式 */
.input-wrapper {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  padding: 24rpx;
  display: flex;
  gap: 16rpx;
  box-shadow: 0 -4rpx 20rpx rgba(0,0,0,0.05);
}

/* 输入框占 85% */
.input-box {
  flex: 1; /* 关键属性 */
  min-width: 0; /* 防止内容溢出 */
  background: #f8f9fa;
  border-radius: 48rpx;
  padding: 20rpx 32rpx;
  font-size: 28rpx;
  height: 80rpx;
  line-height: 80rpx;
}

/* 发送按钮占 15% */
.send-btn {
  flex: 0 0 120rpx; /* 禁止缩放 */
  width: 120rpx;
  height: 80rpx;
  margin-top: 3%;
  border-radius: 16rpx;
  background: #1890ff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  //border-radius: 70%;
}

.send-icon {
  width: 70rpx;
  height: 45rpx;
  filter: brightness(10);
}

/* 加载动画 */
.loading-wrapper {
  padding: 40rpx 0;
  display: flex;
  justify-content: center;
}

.dot-flashing {
  position: relative;
  width: 12rpx;
  height: 12rpx;
  border-radius: 6rpx;
  background-color: #1890ff;
  color: #1890ff;
  animation: dot-flashing 1s infinite linear alternate;
  animation-delay: 0.5s;
}

.dot-flashing::before,
.dot-flashing::after {
  content: "";
  display: inline-block;
  position: absolute;
  top: 0;
}

.dot-flashing::before {
  left: -20rpx;
  width: 12rpx;
  height: 12rpx;
  border-radius: 6rpx;
  background-color: #1890ff;
  color: #1890ff;
  animation: dot-flashing 1s infinite alternate;
  animation-delay: 0s;
}

.dot-flashing::after {
  left: 20rpx;
  width: 12rpx;
  height: 12rpx;
  border-radius: 6rpx;
  background-color: #1890ff;
  color: #1890ff;
  animation: dot-flashing 1s infinite alternate;
  animation-delay: 1s;
}

@keyframes dot-flashing {
  0% { opacity: 0.2 }
  50%, 100% { opacity: 1 }
}